const storage = {
  get (key) {
    let value = localStorage.getItem(key)
    if (value) {
      value = JSON.parse(value)
      return value
    } else {
      return false
    }
  },
  set (key, data) {
    window.localStorage.setItem(key, JSON.stringify(data))
  },
  remove (key) {
    localStorage.removeItem(key)
  },
  clear () {
    localStorage.clear()
  }
}

export default storage